package com.kk.miaosha.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kk.miaosha.Vo.IksQuery;
import com.kk.miaosha.Vo.IksVo;
import com.kk.miaosha.entity.ItemKillSuccess;
import com.kk.miaosha.mapper.ItemKillSuccessMapper;
import com.kk.miaosha.service.ItemKillSuccessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * <p>
 * 秒杀成功订单表 服务实现类
 * </p>
 *
 * @author kk
 * @since 2020-09-18
 */
@Service
@Transactional //开启事务
@Slf4j
public class ItemKillSuccessServiceImpl extends ServiceImpl<ItemKillSuccessMapper, ItemKillSuccess> implements ItemKillSuccessService {
    @Resource
    private ItemKillSuccessMapper iksMapper;

    @Override
    public HashMap<String, Object> getIksList(IksQuery iksQuery) {
        HashMap<String, Object> map=new HashMap<>();
        List<IksVo> list=iksMapper.getIksList(iksQuery);
        int count=baseMapper.selectCount(null);
        map.put("orders",list);
        map.put("total",count);
        return map;
    }
}
